package org.oppoweb.emf.ecore
{

  /**
   * A representation of a value held by a feature of an object.
   * In the case of a {@link org.eclipse.emf.ecore.InternalEObject#eSetClass dynamic} instance,
   * a setting will be the only actual representation of the object-feature-value association.
   */
  public interface Setting
  {
    /**
     * Returns the object holding a value.
     * @return the object holding a value.
     */
    function getEObject():EObject;

    /**
     * Returns the specific feature holding a value for the object.
     * @return the specific feature holding a value for the object.
     */
    function getEStructuralFeature():EStructuralFeature;

    /**
     * Returns the value held by the feature of the object;
     * it optionally {@link org.eclipse.emf.ecore.util.EcoreUtil#resolve(EObject, EObject) resolves} the value.
     * @param resolve whether to resolve.
     * @return the value held by the feature of the object.
     * @see EObject#eGet(EStructuralFeature, boolean)
     */
    function getValue(resolve:Boolean):Object;

    /**
     * Set the value held by the feature of the object.
     * If the new value is this setting itself, or is modified as a side effect of modifying this setting
     * (i.e., if it is a view on the setting),
     * the behavior is undefined and will likely result in simply clearing the list.
     * @param newValue the newValue.
     * @see EObject#eSet(EStructuralFeature, Object)
     */
    function setValue(newValue:Object):void;

    /**
     * Returns whether a value is held by the feature of the object.
     * @return whether a value is held by the feature of the object.
     * @see EObject#eIsSet(EStructuralFeature)
     */
    function isSet():Boolean;

    /**
     * Unsets the value held by the feature of the object.
     * @see EObject#eUnset(EStructuralFeature)
     */
    function unset():void;
  }
}